class User
{
/**
* @ORM\Column(type="string", nullable=false)
*/
This file contains 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 archive_all(testOnly) { | |
messages = $("._5blh") | |
console.log("Found", messages.length, "messages on messsenger."); | |
if (!testOnly) { | |
for (i = 0; i < messages.length; i++) { | |
try { | |
messages[i].click()// open dialog | |
$("li:contains('Archive')").last().click() |
This file contains 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
{ | |
"desc": "kanji frequency for NHK News Web Easy, 1855 articles from 2014-12-02 to 2016-07-15", | |
"source": "https://gist.github.com/adrian17/836b97ee5740b20e63edbe35251d6bc1", | |
"label": "easy news", | |
"total": 158118, | |
"list": [ | |
[ | |
"人", | |
5093 | |
], |
This file contains 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
/** | |
* multipleEventsListeners.js | |
* Add the capability to attach multiple events to an element, just like jQuery does | |
* https://gist.github.com/juanbrujo/a1f77db1e6f7cb17b42b | |
*/ | |
function multipleEventsListeners(elem, events, func) { | |
var event = events.split(' '); | |
for (var i = 0; i < event.length; i++) { | |
elem.addEventListener(event[i], func, false); |
This file contains 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 archive_all(testOnly) { | |
var someMessages, archiveButton; | |
if (testOnly === "undefined") { testOnly = false; } | |
someMessages = $("li._k- span.accessible_elem"); | |
console.log("Found", someMessages.length, "messages to archive in your inbox."); | |
archiveButton = null; | |
someMessages.each(function () { |
I have following object:
var cities={10:'Tashkent', 14:'Karakalpakiya', 16:'Andijan'};
I want sort it by city names, so after sort it should be:
var cities={16:'Andijan', 14:'Karakalpakiya', 10:'Tashkent'};
But I can't sort object properties, instead can convert object into array, then sort items.
This file contains 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
<?php | |
class BlogController extends Controller | |
{ | |
/** | |
* Posts | |
* | |
* @return void | |
*/ | |
public function showPosts() |
This file contains 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 io = require('socket.io').listen(8000), | |
nicknames = {}; | |
io.sockets.on('connection', function (socket) { | |
socket.on('user message', function (msg) { | |
socket.broadcast.emit('user message', socket.nickname, msg); | |
}); | |
socket.on('nickname', function (nick, fn) { | |
if (nicknames[nick]) { |