Skip to content

Instantly share code, notes, and snippets.

View spiegel-im-spiegel's full-sized avatar
😀
being hired

Spiegel spiegel-im-spiegel

😀
being hired
View GitHub Profile
@3846masa
3846masa / !readme.md
Last active August 16, 2022 14:55
#vscode Visual Studio Codeのmarkdownでmathjaxを使えるようにするパッチ(仮)

Visual Studio Codeのmarkdownでmathjaxを使えるようにするパッチ(仮)

無保証

導入方法

  • markdownWorker.js にパッチを当てる
    • WindowsではC:\Users\{USER}\AppData\Local\Code\app-0.1.0\resources\app\client\vs\languages\markdown
    • パッチを当てる前に,js-beautifyで整形してください
@hrdaya
hrdaya / file0.js
Last active August 29, 2015 14:16
JavaScriptで正規表現(数字操作編) ref: http://qiita.com/hrdaya/items/9afafc571827358de3cd
/**
* 文字列を整数にして返す(parseInt)
*
* 全角の数字は半角にする
* 全角ハイフン、全角ダッシュ、全角マイナス記号、長音符は半角ハイフンに変換
* 先頭のマイナス以外のハイフンは削除
*
* 「abcd -ー123かー456」→「-123456」
* 「abc123456def」→「123456」
* 「A0000123456」→「123456」
@hrdaya
hrdaya / file0.js
Last active August 29, 2015 14:16
文字列の左側を任意の文字で任意の桁数に埋める(2種類) ref: http://qiita.com/hrdaya/items/ec459928737d66b28015
/**
* 任意の桁数に切り取った文字列を返す
* 桁数に足りない場合は任意の文字で左側を埋める
*
* @param {String} val 元の文字
* @param {Number} num 桁数
* @param {String} pad 文字埋めに使用する文字列
* @return {String} 作成した文字列
*/
var padSlice = function(val, num, pad) {
@hyuki0000
hyuki0000 / git-config-https-to-git.rb
Last active August 29, 2015 14:10
Change remote.origin.url from "https://..." to "git@...".
#!/usr/bin/env ruby
url = `git config remote.origin.url`
puts "BEFORE: #{url}"
# https://YOURNAME@example.com/YOURNAME/myrepo.git
if url.match(/https:\/\/([^\/@]+@)?([^\/]+)\/([^\/]+)\/(.+)\.git/)
optional_login_name, domain, name, repo = $1, $2, $3, $4
cmd = "git remote set-url origin git@#{domain}:#{name}/#{repo}.git"
puts cmd
@hyuki0000
hyuki0000 / README
Last active August 29, 2015 14:06
AutoGetter - Twitterで自分のツイートから自分へのリプライをまとめるRubyスクリプト(連ツイまとめ作成用)
## AutoGetter - Twitterで自分のツイートから自分へのリプライをまとめるRubyスクリプト(連ツイまとめ作成用)
https://gist.github.com/hyuki0000/85989bcf78d1476d74d3
1. config.yamlを自分用に作成する。
2. ruby autogetter.rb を実行する。
3. 自分へのリプライ(リプライ連鎖)ごとに 1.html, 2.html, 3.html, ... とファイルにまとめる(既存ファイル上書き)。
4. HTMLが直接書けるサイトに貼り付ける。
package mail;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
@Gab-km
Gab-km / github-flow.ja.md
Last active April 25, 2024 04:01 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)
@bohman
bohman / viewport.js
Last active November 20, 2020 11:37
jQuery get viewport size
// -----------
// Debugger that shows view port size. Helps when making responsive designs.
// -----------
function showViewPortSize(display) {
if(display) {
var height = jQuery(window).height();
var width = jQuery(window).width();
jQuery('body').prepend('<div id="viewportsize" style="z-index:9999;position:fixed;top:40px;left:5px;color:#fff;background:#000;padding:10px">Height: '+height+'<br>Width: '+width+'</div>');
jQuery(window).resize(function() {
@poutyface
poutyface / git
Created December 29, 2010 17:37
gitの使い方
githubへ登録
===========
git remote add origin git@github.com:<username>/<application_name>.git
git push origin master
初期設定
=======
git config --global user.name "Foo Bar"
git config --global user.email "foo@bar.com"