Skip to content

Instantly share code, notes, and snippets.

View dd1994's full-sized avatar
💭
I may be slow to respond.

JIANG Di dd1994

💭
I may be slow to respond.
View GitHub Profile
@dd1994
dd1994 / Rakefile
Last active August 29, 2015 14:12 — forked from twistedmind/Rakefile
directory "tmp"
file "tmp/hello.tmp" => "tmp" do
sh "echo 'Hello' > 'tmp/hello.tmp'"
end
task :default => 'morning:turn_off_alarm'
namespace :morning do
desc "Turn off alarm."
#include <iostream>
using namespace std;
// big -> small
void BubbleSort(int a[]) {
int i, j, temp;
for (i = 0; i < 3; i++) {
for (j = i + 1; j < 4 ; j++) {
if (a[i] < a[j]) {
#!/bin/bash
# Pull this file down, make it executable and run it with sudo
# wget https://gist.githubusercontent.com/bryanhunter/10380945/raw/build-erlang-17.0.sh
# chmod u+x build-erlang-17.0.sh
# sudo ./build-erlang-17.0.sh
if [ $(id -u) != "0" ]; then
echo "You must be the superuser to run this script" >&2
exit 1
fi
module Enumerable
def i_each_slice(n, &block)
raise "invalid slice size" if n <= 0
i, ary = 0, []
each do |a|
ary << a
i += 1
if i >= n
@dd1994
dd1994 / subl_plugin.md
Last active August 29, 2015 14:19
my sublime plugins
  • elixir
  • gitgutter
  • SideBarEnhancements
  • HTML5
  • All Autocomplete
  • Pretty JSON
  • Java​Script & Node​JS Snippets
  • gitsavvy
  • Sublime-JSHint
  • better coffeescript
@dd1994
dd1994 / install.md
Last active August 29, 2015 14:20 — forked from galulex/install.md

Developer libs

mysql, rmagic, curl, git, vim, sqlite, nodejs nokogiri...

sudo apt-get install libxslt1-dev libxml2-dev libmagickwand-dev imagemagick libsqlite3-dev libcurl4-openssl-dev curl git git-gui vim-gtk exuberant-ctags nodejs nodejs-legacy rar

Ruby

sudo apt-get install python-software-properties

sudo apt-add-repository ppa:brightbox/ruby-ng

@dd1994
dd1994 / http-get.js
Created June 20, 2015 03:47
node http.get example
'use strict';
let http = require('http');
let hnApi = 'http://node-hnapi.herokuapp.com/news';
let news = '';
let hackerNews;
let req = http.get(hnApi, function(res) {
res.on('data', function(chunk) {
news += chunk;
@dd1994
dd1994 / http_get.rb
Created June 20, 2015 03:48
ruby http get example
require "net/http"
require "json"
news_string = Net::HTTP.get(URI('http://node-hnapi.herokuapp.com/news'))
news = JSON.parse(news_string)
puts news
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_size": 14,
"ignored_packages":
[
"Vintage"
],
"save_on_focus_lost": true,
"tab_size": 2,

这几年,我只是一心想要前进,想要碰触那些无法触及的东西。 却不知道那具体指什么,也不清楚那可以说是威胁的想法从何而来。 只是不断的前进着,等我回过神来,日渐疲惫的心,是如此痛苦。 然后某一天清晨,我发觉自己从前那么认真诚恳的感情,已经消失得无影无踪,才了解到自己已经到了极限时,我辞职了。


我清楚的知道,我们无法保证将来能在一起,横亘在我们面前的是那沉重的人生和漫长的时间,让人望而却步。