Skip to content

Instantly share code, notes, and snippets.

View sergenes's full-sized avatar
🏠
Working from home

Sergey Neskoromny sergenes

🏠
Working from home
View GitHub Profile
@zats
zats / AGENTS.md
Created August 25, 2025 01:20
Teaching codex to search internet with gemini-cli

Web Search Tool

Overview

This tool uses the Gemini CLI to retrieve up-to-date information directly from the internet in a single streamed response. It is suited for requesting the model to actively search the public web for best practices and fresh knowledge beyond local context.

Usage

Explicitly instructing the model to search the internet for a focused topic:

//first
dispatch_async(queue, ^{
dispatch_group_t group1 = dispatch_group_create();
// Tasks goes here
for (NSInteger i = 0; i < 3; i++) {
@derickito
derickito / PDFViewController.swift
Last active October 29, 2024 04:32
iOS PDFKit: How to add a highlight annotation
override func viewDidLoad() {
createMenu()
}
private func createMenu() {
let highlightItem = UIMenuItem(title: "Highlight", action: #selector(highlight(_:)))
UIMenuController.shared.menuItems = [highlightItem]
}
@objc private func highlight(_ sender: UIMenuController?) {
@tasomaniac
tasomaniac / screenrecord.sh
Last active October 26, 2025 18:44 — forked from PaulKinlan/getdeviceart.sh
Screen Record for Android
#!/bin/sh
set -e
if [ -z "$1" ]; then
shot_path=$(date +%Y-%m-%d-%H-%M-%S).mp4
else
shot_path="$*"
fi
@kiichi
kiichi / ScreenshotViewController.swift
Created January 5, 2016 04:12
Example to capture the NSView screenshot in Mac App
import Cocoa
class ScreenshotViewController: NSViewController {
override func prepareForSegue(segue: NSStoryboardSegue, sender: AnyObject?) {
if let viewController = segue.destinationController as? PreviewViewController{
viewController.image = getScreenshot()
}
}
func getScreenshot() -> NSImage {
@kaloprominat
kaloprominat / xcode objective-c GCD dispatch group wait example
Last active August 5, 2023 10:50
xcode objective-c GCD dispatch group wait example
//first
dispatch_async(queue, ^{
dispatch_group_t group1 = dispatch_group_create();
// Tasks goes here
for (NSInteger i = 0; i < 3; i++) {
@stavfx
stavfx / Logger.java
Last active December 24, 2015 13:49
Android Logger class that prints out info about the calling method, just call Log.w("msg") but still get a detailed log and never forget where that log call came from :)
/**
* Created by StavFX on 10/3/13.
*/
public class Log {
private static final boolean DEBUG = true;
private static final String NEW_LINE = System.getProperty("line.separator");
public static void w(String tag, String msg) {
log(tag, msg);
}
@tedmiston
tedmiston / nodejs-tcp-example.js
Last active April 1, 2025 08:06
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@dodyg
dodyg / gist:5823184
Last active July 13, 2025 08:51
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@nathan-osman
nathan-osman / CMakeLists.txt
Last active October 21, 2025 05:13
Generates a self-signed x509 certificate using OpenSSL.
# A simple CMake script for building the application.
cmake_minimum_required(VERSION 2.8)
project(create-x509)
# Our only dependency is OpenSSL
find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
add_executable(create-x509 create-x509.cpp)