Skip to content

Instantly share code, notes, and snippets.

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

ngn999 ngn999

💭
I may be slow to respond.
View GitHub Profile
@ngn999
ngn999 / 0_reuse_code.js
Created May 7, 2014 07:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ngn999
ngn999 / url-encode-ty.md
Last active August 29, 2015 14:09
url-encode-ty.md

在emacs里做url encoding. 最好你的环境是utf-8

(defun url-encode-ty ()
  (interactive)
  (let* ((origin-string (buffer-substring-no-properties (region-beginning) (region-end)))
         ;; (new-string (url-hexify-string origin-string))
         (new-string
 (with-temp-buffer
@ngn999
ngn999 / xml2vcf
Last active August 29, 2015 14:15
convert ontacts.xml iCloud.vcf
#!/usr/bin/env perl
use strict;
use Text::vCard::Addressbook;
use XML::Simple qw(:strict);
use Data::Dumper;
my $address_book = new Text::vCard::Addressbook;
my $doc = XMLin('./contacts.xml', KeyAttr => { }, ForceArray => [ 'people', 'phone' ]);
foreach my $p (@{$doc->{people}}) {
@ngn999
ngn999 / xkc.pl
Last active October 26, 2017 08:19
杭州小客车查询脚本
#!/usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;
use Data::Dumper;
my $ua = LWP::UserAgent->new;
my $url = 'http://apply.hzcb.gov.cn/apply/app/status/norm/person';
my $issueNumber = '201709';
@ngn999
ngn999 / introrx.md
Created May 5, 2016 03:34 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
source ~/.bash_profile
cd ${SRCROOT}
/path/to/xctool.sh -reporter json-compilation-database:compile_commands.json clean
/path/to/xctool.sh -reporter json-compilation-database:compile_commands.json build
oclint-json-compilation-database | sed 's/\(.*\.\m\{1,2\}:[0-9]*:[0-9]*:\)/\1 warning:/'
@ngn999
ngn999 / SMBDIS.ASM
Created January 23, 2018 03:28 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger ([email protected])
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@ngn999
ngn999 / ballot.sol
Created June 15, 2018 02:00
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25-nightly.2018.6.12+commit.56a965ea.js&optimize=false&gist=
pragma solidity ^0.4.0;
contract Ballot233 {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
! Put user rules line by line in this file.
! See https://adblockplus.org/en/filter-cheatsheet
||appium.io^
||zh.wikipedia.org^
||ycombinator.com^
||news.ycombinator.com^
||en.wikipedia.org^
||a.udemycdn.com^
||hls.udemycdn.com^
||udemycdn.com^
! Put user rules line by line in this file.
! See https://adblockplus.org/en/filter-cheatsheet
||appium.io^
||zh.wikipedia.org^
||ycombinator.com^
||news.ycombinator.com^
||en.wikipedia.org^
||a.udemycdn.com^
||hls.udemycdn.com^
||udemycdn.com^