Skip to content

Instantly share code, notes, and snippets.

View tomsihap's full-sized avatar

tomsihap

View GitHub Profile

Remove a column

We want to remove the column name from table user

current version, V 1.0

class User
{
  /**
   * @ORM\Column(type="string", nullable=false)
 */
@elibosley
elibosley / archive-all-facebook-messages.js
Last active March 6, 2024 03:36 — forked from tedmiston/archive-all-facebook-messages.js
Archive all of the messages in your Facebook Messages Inbox
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()
@adrian17
adrian17 / kanji_easy.json
Last active June 2, 2023 18:43
kanji data for NHK News Web Easy
{
"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
],
@juanbrujo
juanbrujo / multipleEventsListeners.js
Last active October 5, 2023 20:39
Add the capability to attach multiple events to an element, just like jQuery does
/**
* 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);
@tedmiston
tedmiston / archive-all-facebook-messages.js
Last active April 8, 2024 07:36
Archive all of the messages in your Facebook Messages Inbox
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 () {
@umidjons
umidjons / sort-object-properties-by-value.md
Last active January 16, 2024 13:00
JavaScript: sort object properties by value (numeric or string)

Sort object properties by value (values are text)

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.

@tobysteward
tobysteward / BlogController.php
Last active March 4, 2024 23:11
Laravel AJAX Pagination with JQuery
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()
@anandgeorge
anandgeorge / app.js
Created May 27, 2012 16:15
Socket.io example with jquery and dom manipulation
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]) {