Skip to content

Instantly share code, notes, and snippets.

View gaishimo's full-sized avatar
🏠
Coding 💻

gaishimo gaishimo

🏠
Coding 💻
View GitHub Profile
@bdotdub
bdotdub / redis.markdown
Created November 24, 2010 22:18
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

@kares
kares / jquery.parseparams.js
Created May 5, 2011 11:28
jQuery.parseParams - parse query string paramaters into an object
/**
* $.parseParams - parse query string paramaters into an object.
*/
(function($) {
var re = /([^&=]+)=?([^&]*)/g;
var decodeRE = /\+/g; // Regex for replacing addition symbol with a space
var decode = function (str) {return decodeURIComponent( str.replace(decodeRE, " ") );};
$.parseParams = function(query) {
var params = {}, e;
while ( e = re.exec(query) ) {
@hail2u
hail2u / csslint-rules.md
Last active April 29, 2023 14:59
CSSLintのRulesの超訳

訳注

これは超訳です。

CSSLintは「なんでこんなルールなんだ…」とイラっとすることが多いですけど、それぞれにそれなりに理由があります。まぁ勿論無視するべきなルールとかもあります。例えば見出し要素の再定義禁止とかはHTML5に対するCSSなら無理な話です。そんなわけでどんな理由なのかを簡単に訳しました。無視するかどうかは自分で決めましょう!

この訳はCSSLintと同じライセンスで提供されます。

Possible Errors

@pxsta
pxsta / app.js
Created October 22, 2012 14:44
Socket.io-Express3.x-session
"use strict";
var express = require('express')
, http = require('http')
, path = require('path')
, io = require('socket.io')
, connect = require("express/node_modules/connect")
, Session = express.session.Session
, app = express();
//メモリストアかRedisのどちらかでセッションを保存
@mzdakr
mzdakr / ServerMonitoringWithGAS.js
Last active January 29, 2018 02:12
Google Apps Script を使って簡易的にWEBサーバの死活監視をするスクリプトです。 外部からURL叩いて 200 が返ってこなかったらメールをするだけのとてもシンプルなコードです。 Google Apps Scriptを採用した理由は 1) JSで書けてお手軽 2)Google Apps Scriptで定期実行が可能 3) Google Apps の基盤上で動かせるので可用性が高い の3つです。 毎分スクリプトを動かすことができるので便利なのと死活監視自体が死んでるということを極力回避できるというのはポイント高いと思います。死活監視の死活監視なんて新たな死活監視を産むだけです。 Google Apps Scriptはかなり便利なので使ってみてください。
var url = 'http://www.example.com/';
var to = 'foo@example.com';
var sub = 'サーバ障害報告';
var body = "監視中の サーバが停止した模様です。サーバの状態を確認してください。\n" + url ;
function myFunction()
{
if(check_server(url) != 200){
MailApp.sendEmail(to, sub, body);
@imaya
imaya / jser.md
Created March 17, 2014 02:00
JavaScript プログラマの職種は4種類くらいに分けるべき

はじめに

JavaScript を使っていると「JavaScript出来るの? jQuery / AngularJS / Node.js etc... で困ってるんだけどさー」みたいな話を振られることがあります。 そういった時に、自分は一般的なライブラリの使い方やフレームワークに対して大した知見も興味もないので、わざわざ説明するのも面倒なのでこうして文章にしておきます。(本当に届いて欲しい人に限って、こういう文章が届かないのはわかっていますが、文章を書くこと自体が気晴らしだと思って諦めます。)

「フロントエンドエンジニア」という言葉の汎用性

先ほどのような話は自分に限ったことではなく、たぶん経験のある人も多いでしょう。 振られた話が自分の分かる範囲、あるいは興味のあるものならばまだ良いのですが、そうでないことがあまりに多すぎます。 話を振られるだけならともかく「JavaScriptできるんでしょ? じゃあ jQuery つかったこのサービスのメンテしてほしいんだけどー」みたいに仕事として振られることもあり、そう言う時は脳みそ取り出して洗剤で洗った方が良いのでは、と思うことも多々あります。

@voluntas
voluntas / webrtc.rst
Last active May 21, 2024 13:55
WebRTC の未来
@voluntas
voluntas / webrtc.rst
Last active June 27, 2024 02:25
WebRTC コトハジメ
@jarretmoses
jarretmoses / React Native Clear Cache
Last active July 17, 2024 15:14
Clearing the Cache of your React Native Project
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@teppeis
teppeis / es-class-fields.md
Last active March 13, 2022 13:57
ES Class Fieldsのプライベートフィールドがハッシュな変態記法なのは何でなんだぜ?

ES Class Fields (Stage 2 now)

プライベートフィールドがハッシュな変態記法なのは何でなんだぜ?

class Point {
    #x;
    #y;
 constructor(x = 0, y = 0) {