Skip to content

Instantly share code, notes, and snippets.

@fwcd
fwcd / gsoc-2022.md
Last active March 17, 2023 12:20
Google Summer of Code 2022

Overview

My Google Summer of Code 2022 project mainly focused on rewriting parts of the SwiftSyntax library using its own SwiftSyntaxBuilder DSL, more specifically, porting the gyb templates in SwiftSyntaxBuilder to type-safe Swift code, written using the library itself. During this bootstrapping process, many improvements to the DSL were added, inconveniences in the (quite large) API surface fixed and thoroughly tested. The result is a robust and ergonomic API for generating Swift code that has proven to be useful in the context of a medium-sized codebase.

The Project: Bootstrapping SwiftSyntaxBuilder

The first step was to set up the build infrastructure. In particular this required adding a new target that, when executed, produced the generated Swift files in SwiftSyntaxBuilder/generated:

flowchart LR
@rufoa
rufoa / Jenkinsfile
Created May 13, 2019 02:29
Jenkins [skip ci] implementation for multi-branch declarative pipeline
// change 'agent' lines as appropriate
pipeline {
agent none
stages {
stage('Run CI?') {
agent any
steps {
@kosh04
kosh04 / .gitignore
Last active November 21, 2024 06:03
Chrome Cookies Decrypter
cookie.txt
@darcyliu
darcyliu / centos7_timechine.sh
Last active April 25, 2022 18:17
Install Time Machine service on CentOS 7
# Install Time Machine service on CentOS 7
# http://netatalk.sourceforge.net/wiki/index.php/Netatalk_3.1.7_SRPM_for_Fedora_and_CentOS
# http://confoundedtech.blogspot.com/2011/07/draft-draft-ubuntu-as-apple-time.html
yum install -y rpm-build gcc make wget
# install netatalk
yum install -y avahi-devel cracklib-devel dbus-devel dbus-glib-devel libacl-devel libattr-devel libdb-devel libevent-devel libgcrypt-devel krb5-devel mysql-devel openldap-devel openssl-devel pam-devel quota-devel systemtap-sdt-devel tcp_wrappers-devel libtdb-devel tracker-devel
yum install -y bison docbook-style-xsl flex dconf
@mikeash
mikeash / runtime-class.m
Created November 22, 2013 16:46
Creating a usable class purely at runtime using the Objective-C runtime APIs.
// clang -fobjc-arc -framework Foundation runtime-class.m
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
@interface Person : NSObject
- (id)initWithFirstName: (NSString *)firstName lastName: (NSString *)lastName age: (NSUInteger)age;
@the-teacher
the-teacher / class_exists.rb
Created August 23, 2013 13:08
ruby check for class exists
# the_class_exists? :User => true | false
# the_class_exists? :Role => true | false
def the_class_exists?(class_name)
klass = Module.const_get(class_name)
return klass.is_a?(Class)
rescue NameError
return false
end
@cloudsben
cloudsben / md-menu.html
Last active June 14, 2023 07:46
markdown menu
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.2/styles/googlecode.min.css">
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="http://yandex.st/highlightjs/6.2/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script type="text/javascript">
$(document).ready(function(){
$("h2,h3,h4,h5,h6").each(function(i,item){
var tag = $(item).get(0).localName;
@zilongshanren
zilongshanren / 抽奖送书
Last active December 15, 2015 06:59
《Cocos2D权威指南》送书脚本
import csv
from random import randint
import sys
#determin whether args is legal or not
#抽奖文件名
filename = sys.argv[1]
#中奖序列号起始值
startNum = int(sys.argv[2])
#中奖序列号结束值
@johnjohndoe
johnjohndoe / redmine-osx-installation.md
Created May 21, 2012 16:51
Redmine installation on MacOSX

Redmine installation on MacOSX

  • A summarized instruction tested on MacOSX 10.7.4 installing Ruby 1.9.3p194 and Rails 3.2.3.

Install brew

brew hints

@interface UIImage (fixOrientation)
- (UIImage *)fixOrientation;
@end