Skip to content

Instantly share code, notes, and snippets.

@icoxfog417
icoxfog417 / gist:5439742
Last active December 16, 2015 13:09
LINQ from DataTable and Group by
From row In listData.AsEnumerable
Group row By _
NAME = row.Field(Of String)("NAME") _
Into g = Group
Let SCORE = g.Sum(Function(row) row.Field(Of Integer)("SCORE"))
Select NAME,SCORE
@icoxfog417
icoxfog417 / gist:5793956
Created June 17, 2013 00:12
Compile All Objects In Oracle
begin
UTL_RECOMP.RECOMP_SERIAL('TARGET_SCHEMA_NAME'); --TARGET_SCHEMA_NAME is compile target schema name
end;
@icoxfog417
icoxfog417 / gist:6119354
Created July 31, 2013 04:48
Enum enumeration
For Each e As String In System.Enum.GetValues(GetType(SampleType))
Dim typeNow As SampleType = CType([Enum].Parse(GetType(SampleType), e), SampleType)
Next
@icoxfog417
icoxfog417 / gist:6127898
Last active December 20, 2015 11:59
Oracle executing SQL
--SQL
select sid,serial#,username,logon_time,q.SQL_ID,q.SQL_TEXT
from v$session s,v$sql q
where s.SQL_ID=q.SQL_ID
--SQL ALL
select SQL_TEXT from v$sqltext b WHERE b.SQL_ID = :pId ORDER BY PIECE
@icoxfog417
icoxfog417 / gist:7520661
Created November 18, 2013 00:57
get properties that have attribute by LINQ
Dim targets = _
From p As PropertyInfo In props
Let attribute As XXXAttribute = p.GetCustomAttributes(GetType(XXXtAttribute), True).SingleOrDefault
Where Not attribute Is Nothing
Select p, attribute
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@icoxfog417
icoxfog417 / file0.sh
Last active October 30, 2018 04:56
リモートから特定のブランチを指定してcloneする ref: https://qiita.com/icoxfog417/items/5776e0f0f758f0f0e48a
git clone -b ブランチ名 https://リポジトリのアドレス
@icoxfog417
icoxfog417 / file0.txt
Created January 22, 2014 08:37
Gitで特定のコミットの状態のブランチを作成する ref: http://qiita.com/icoxfog417/items/6b0c1475c61292b42244
git branch -l ブランチ名 コミット番号
(function () {
"use strict";
kintone.events.on(['app.record.detail.show','app.record.create.show','app.record.edit.show'], function(event){
var toggle = document.getElementById("goog-splitpane-handle-gaia"); //コメント/変更履歴欄を閉じる
if(toggle == null){
return false;
}else{
if(toggle.getAttribute("class").indexOf("contents-resizer-handle-open-gaia") > -1){
// send to current request socket client
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.sockets.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender