Skip to content

Instantly share code, notes, and snippets.

View zzz6519003's full-sized avatar
🏀
Trying to Find a Team

Sam Snowman(赵正中) zzz6519003

🏀
Trying to Find a Team
View GitHub Profile
@loschtreality
loschtreality / perm.js
Created January 27, 2017 20:08
Permutations in JS & Ruby
// Given a string, write a function that uses recursion to output a list of all the possible permutations of that string.
// For example, given s='abc' the function should return ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
// Note: If a character is repeated, treat each occurence as distinct,
// for example an input of 'xxx' would return a list with 6 "versions" of 'xxx'
const permutations = (string) => {
let output = []
@chenglou
chenglou / anagram.cljs
Last active January 20, 2016 05:31
ClojureScript anagram implementation
; (group-by f list): call f on each item in list. The return value becomes a key
; of the resulting map, whose keys map to the list of items for which f returned
; that key.
; (vals map): returns a list of the values of the map.
(defn anagram [words] (vals (group-by sort words)))
(= (anagram ["star" "rats" "car" "arc" "stars"])
[["star" "rats"] ["car" "arc"] ["stars"]]) ; true
@whatnickcodes
whatnickcodes / chrome-cache-recovery.js
Last active November 23, 2016 05:32
Quick and dirty script to recover images from chrome cache. Just paste this into your console to automatically download all Scotch.io cached images
// Open chrome://cache/ and paste the following script in the console. Feel free to edit the filter variable
var filter = /cask\.scotch\.io(.)*\.(jpg|jpeg|png|gif)/g;
/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);retu
@LoganBarnett
LoganBarnett / 2015-react-rally.md
Last active February 25, 2016 14:01
Notes from the 2015 React Rally conference.
@hashrock
hashrock / vuejs.md
Last active October 5, 2023 23:42
Vue.js資料まとめ(古いので注意)

#まず見るべき

以下のURLは、常に更新されているコンテンツです。

@zzz6519003
zzz6519003 / gist:c290ad8afbfce7d67770
Last active August 29, 2015 14:04
为什么不应该把cell给替换成view
-----------------
C |
|
------------ |
A | |
a | |
| |
b |
------------ |
B |
@hayeah
hayeah / gist:8204839
Created January 1, 2014 03:43
interesting snippet to get the minified key of an object. from react JS
/**
* Allows extraction of a minified key. Let's the build system minify keys
* without loosing the ability to dynamically use key strings as values
* themselves. Pass in an object with a single key/val pair and it will return
* you the string key of that single record. Suppose you want to grab the
* value for a key 'className' inside of an object. Key/val minification may
* have aliased that key to be 'xa12'. keyOf({className: null}) will return
* 'xa12' in that case. Resolve keys you want to use once at startup time, then
* reuse those resolutions.
*/
/*
#####################################################################
# File : MHGSwipeNavigationController.h
# Project : StockBar
# Created : 13-12-30
# DevTeam : Thomas
# Author : 缪 和光
# Notes :
#####################################################################
### Change Logs ###################################################
@j67678
j67678 / function.php
Created November 2, 2013 09:51
抓取正方课表
<?php
function str_extract($string,$before,$after){
if(!strpos($string, $before))return false;
$start = strpos($string, $before) + strlen($before);
$string = substr($string, $start);
$end = strpos($string, $after);
return substr($string, 0, $end);
}
function strip_breaks($str){
$str = str_replace('
@Kjuly
Kjuly / remove_all_viewdidunload_snippets_from_your_projects_vcs.md
Last active December 24, 2015 03:29
The method -viewDidUnload is deprecated in iOS 6.0. Here offers a way to remove all -viewDidUnload snippets from your project's view controllers in batch.

Remove All -viewDidUnload Snippets From Your Project's VCs

As Apple's Official Doc said:

-viewDidUnload is deprecated in iOS 6.0. Views are no longer purged under low-memory conditions and so this method is never called.

Meanwhile, it's better to remove all -viewDidUnload implements from projects that the deployment target is iOS 6.0 or later. But removing it one by one is boring, especially you've hundreds of controllers & several projects.

So, is there any script or command can do this batch job?