This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ways to execute a shell script in Ruby | |
# Example Script - Joseph Pecoraro | |
cmd = "echo 'hi'" # Sample string that can be used | |
# 1. Kernel#` - commonly called backticks - `cmd` | |
# This is like many other languages, including bash, PHP, and Perl | |
# Returns the result of the shell command | |
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.cookie = "wvr=5; path=/; domain=.weibo.com"; | |
document.cookie = "wvr6=0; path=/; domain=.weibo.com"; | |
location.reload(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.cookie = "wvr=6; path=/; domain=.weibo.com"; | |
document.cookie = "wvr6=1; path=/; domain=.weibo.com"; | |
location.reload(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var random = Math.round(Math.random()); | |
document.cookie = "wvr=" + (5 + random) + "; path=/; domain=.weibo.com"; | |
document.cookie = "wvr6=" + random + "; path=/; domain=.weibo.com"; | |
location.reload(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var map = { | |
R079: '銀座', | |
R119: '渋谷', | |
R224: '表参道' | |
}; | |
var model = ['MG4F2J/A', 'MG4J2J/A']; | |
// 灰色 64G, 金色 64G | |
function check() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- title:108: 题外话 之3 | |
主题: 108: 题外话 之3 | |
主播: 贺愉(新浪微博@贺愉;微信公众号: 迷失音乐) | |
封面设计: 阿喵 | |
简介: 叨逼叨逼叨 | |
歌单: | |
01.London Grammar - Shyer | |
02.Mira Billotte(White Magic) - As I Went Out One Morning | |
03.Bob Dylan - As I Went Out One Morning |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Date Format 1.2.3 | |
* (c) 2007-2009 Steven Levithan <stevenlevithan.com> | |
* MIT license | |
* | |
* Includes enhancements by Scott Trenda <scott.trenda.net> | |
* and Kris Kowal <cixar.com/~kris.kowal/> | |
* and leplay <https://gist.github.com/leplay/e9fafa24e29d8bfe5688> | |
* | |
* Accepts a date, a mask, or a date and a mask. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (window) { | |
define([], function () { | |
var FormatDate = function (format, date) { | |
date = date ? new Date(parseInt(date, 10)) : new Date(); | |
var output = format.replace(/y{4}|D{2}|M{2}|d{2}|h{2}|H{2}|m{2}|s{2}/g, function (keyword) { | |
var result = ''; | |
switch (keyword) { | |
case 'yyyy': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var counter = {}; | |
var dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; | |
_.each(dayNames, function(name) { | |
counter[name] = 0; | |
}) | |
$.ajax({ | |
url: 'https://www.producthunt.com/frontend/collections/the-1000-club?id=the-1000-club' | |
}).done(function(resp){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript | |
function getParameterByName(name, url) { | |
if (!url) url = window.location.href; | |
name = name.replace(/[\[\]]/g, "\\$&"); | |
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), | |
results = regex.exec(url); | |
if (!results) return null; | |
if (!results[2]) return ''; | |
return decodeURIComponent(results[2].replace(/\+/g, " ")); |
OlderNewer